#include <stdio.h>

int main(){
    FILE *fp;
    fp = fopen("io.txt", "a");
    if(fp == NULL){
        printf("Error opening file\n");
    }
    else{
        printf("File opened successfully\n");
    }
    int fputc_result =fputs("bcdefg", fp);
    if(fputc_result == EOF){
        printf("字符串添加失败\n");
    }
    else{
        printf("字符串添加成功：%d\n",fputc_result);
    }

    int result =fclose(fp);
    if(result == 0){
        printf("File closed successfully\n");
    }
    else{
        printf("Error closing file\n");
    }
    return 0;
}